<div class="topicmenu">
    <div class="box160titleblue">
        {if isset($topic) && !isset($cat) && !isset($sub)}
            <h2 class="pastille_rub"><a href="{$topic.url}">{$topic.nom}</a></h2>
        {else}
            <h2><a href="{$topic.url}">{$topic.nom}</a></h2>
        {/if}
    </div>
    <div class="box160content_topicmenu">
        {if isset($topic) && !isset($cat)}
            {foreach from=$topicmenu item=i name=topicmenu}
                {if $i.category==$topic.nom && $i.category|@sizeof>0}
                    <ul>
                        {foreach from=$i.lvl1 item=j name=sub}
                            {if $j.subcategory|@sizeof>0}
                                <li>
                                    {if isset($cat) && !isset($sub) && $cat.nom == $j.subcategory && !isset($tous)}
                                        <h3 class="pastille_cat"><a href="{$j.subcategory.url}tous/" title="">{$j.subcategory}</a></h3>
                                    {else}
                                        <h3><a href="{$j.subcategory.url}tous/" title="">{$j.subcategory}</a></h3>
                                    {/if}
                                    <ul class="subcat">
                                        {if isset($tous) && $j.subcategory==$cat.nom}
                                            <li><a class="pastille_sub" href="{$url_current_page}tous/" title="">Tous les produits</a></li>
                                        {else}
                                            <li><a href="{$URL_PATH}boutique/{$i.category.slug}/{$j.subcategory.slug}/tous/" title="">Tous les produits</a></li>
                                        {/if}
                                        {foreach from=$j.lvl2 item=k name=subsub}
                                            {if isset($sub) && $sub.nom == $k.subsubcategory.nom && $cat.nom == $j.subcategory}
                                                <li><a class="pastille_sub" href="{$k.subsubcategory.url}" title="">{$k.subsubcategory}</a></li>
                                            {else}
                                                <li><a href="{$k.subsubcategory.url}" title="">{$k.subsubcategory}</a></li>
                                            {/if}
                                        {/foreach}
                                    </ul>
                                </li>
                            {/if}
                        {/foreach}
                    </ul>
                {/if}
            {/foreach}
        {else}
            <!-- Lvll 1 -->
            <ul>
                <li>
                    <h3><a href="{$cat.url}tous/" title="">{$cat}</a></h3>
                    <ul class="subcat">
                     {if !isset($sub)}
                        <li><a class="pastille_sub" href="{$cat.url}tous/" title="">Tous les produits</a></li>
                    {else}
                        <li><a href="{$cat.url}tous/" title="">Tous les produits</a></li>
                    {/if}
                    {foreach from=$cat.subsubcategories item=subcat}
                        {if $subcat.url != ""}
                            {if isset($sub) && $sub.id == $subcat.id}
                            <li><a class="pastille_sub" href="{$subcat.url}">{$subcat}</a></li>
                            {else}
                            <li><a href="{$subcat.url}">{$subcat}</a></li>
                            {/if}
                        {/if}
                    {/foreach}
                    </ul>
                </li>
            </ul>
        {/if}
    </div>
    <div class="clear"></div>
    <div class="box160ass_topicmenu"></div>
</div>